import {
  get,
  post,
  json
} from 'lib/httpPlugin'
import { tracker } from 'lib/analytics'
const domain = process.env.VUE_APP_URL
export default {
  getNewTitles (params = {}, pageNo = 1, pageSize = 100) { // 获取资讯
    return get(`${domain}/main/newsTitles?pageNo=${pageNo}&pageSize=${pageSize}`, params)
  },
  getVideoList (params = {}) { // 获取资讯
    return get(`${domain}/main/articles/MAINVIDEOS`, params)
  },
  getBimList (params = {}) { // 获取资讯
    return get(`${domain}/bim/queryBimCategory`, params)
  },
  showArticle (params = {}, id) { // 获取资讯
    return get(`${domain}/main/showArticle/${id}`, params)
  },
  searchArticle (params = {}, pageNo = 1, pageSize = 100) { // 获取资讯
    return post(`${domain}/main/articles/search?pageNo=${pageNo}&pageSize=${pageSize}`, params)
  },
  downArtZone (params = {}, pageNo = 1, pageSize = 100) { // 获取资讯
    return post(`${domain}/main/articles/DOWNLOADS?pageNo=${pageNo}&pageSize=${pageSize}`, params)
  },
  queryBimCategory (params = {}) { // 获取资讯
    return get(`${domain}/bim/queryBimCategory`, params)
  },
  queryViewToken (params = {}, id) { // 获取资讯
    return get(`${domain}/bim/queryViewToken?fieldId=${id}`, params)
  },
  queryBimVideo (params = {}) { // 获取资讯
    return get(`${domain}/bim/queryBimVideo`, params)
  },
  CY71Categorys (params = {}) { // 获取资讯
    return get(`${domain}/main/articles/CY71Categorys`, params)
  },
  queryUploadObjs (params = {}, cate) { // 获取资讯
    return get(`${domain}/bim/queryUploadObjs?category=${cate}`, params)
  },
  getLeaderList (params = {}, cate) { // 获取资讯
    return get(`${domain}/anzren/personal/list`, params)
  },
  getDFZCFG (params = {}, page = 1, size = 100) { // 获取资讯
    return get(`${domain}/main/articles/DFZCFG?pageNo=${page}&pageSize=${size}`, params)
  },
  getXHWJGG (params = {}, page = 1, size = 100) { // 获取资讯
    return get(`${domain}/main/articles/XHWJGG?pageNo=${page}&pageSize=${size}`, params)
  },
  getZCFG (params = {}, page = 1, size = 100) { // 获取资讯
    return get(`${domain}/main/articles/ZCFG?pageNo=${page}&pageSize=${size}`, params)
  },
  getKJXZ (params = {}, page = 1, size = 100) { // 获取资讯
    return get(`${domain}/main/articles/KJXZ?pageNo=${page}&pageSize=${size}`, params)
  },
  getGLTZ (params = {}, page = 1, size = 100) { // 获取资讯
    return get(`${domain}/main/articles/GLTZ?pageNo=${page}&pageSize=${size}`, params)
  },
  getArticles (params = {}, type, page = 1, size = 100) { // 获取资讯
    return get(`${domain}/main/articles/${type}?pageNo=${page}&pageSize=${size}`, params)
  },
  queryElecBooks (params = {}, cate, page = 1, size = 100) { // 获取资讯
    return get(`${domain}/bim/queryElecBooks?category=${cate}&pageNo=${page}&pageSize=${size}`, params)
  },
  uploadFile (params = {}) { // 上传文件
    return post(`${domain}/main/upload`, params)
  },
  submitCYForm (params = {}) { // 创优评先表单提交
    return post(`${domain}/main/chuangyoupingxianForm`, params)
  },
  submitVIPForm (params = {}) { // 会员表单提交
    return post(`${domain}/main/upload`, params)
  },
  login (params = {}) { // 会员表单提交
    return json(`${domain}/anzren/member/login`, params)
  },
  logout (params = {}) { // 会员表单提交
    return json(`${domain}/anzren/member/loginout`, params)
  },
  regist (params = {}) { // 会员表单提交
    return json(`${domain}/anzren/member/regist`, params)
  },
  memberStepForm (params = {}) {
    return json(`${domain}/anzren/member/memberStepForm`, params)
  },
  getLatestUrl (params = {
    token: tracker.getToken()
  }) {
    return json(`${domain}/anzren/member/getLatestUrl`, params)
  },
  dwsearch (params = {}) {
    return get(`${domain}/anzren/member/dwsearch`, params)
  },
  modifyMemberForm (params = {}) {
    return json(`${domain}/anzren/member/modifyMemberForm`, params)
  },
  validToken (params = {}) {
    return get(`${domain}/anzren/member/validToken`, params)
  },
  getKJCXFormDataById (params = {}) {
    return json(`${domain}/anzren/kejichxin/queryKeJiChuangXinForm`, params)
  },
  getKJCXFormDataList (params = {}) {
    return get(`${domain}/anzren/kejichxin/queryKeJiChuangXinFormList`, params)
  },
  submitKJCXForm (params = {}) {
    return json(`${domain}/anzren/kejichxin/persistKejichxinForm`, params)
  },
  printKeJiChuangXinForm (params = {}) {
    return json(`${domain}/anzren/kejichxin/printKeJiChuangXinForm`, params)
  },
  submitKejichxinForm (params = {}) {
    return json(`${domain}/anzren/kejichxin/submitKejichxinForm`, params)
  },
  deleteKejichxinForm (params = {}) {
    return json(`${domain}/anzren/kejichxin/deleteKejichxinForm`, params)
  },
  queryCgjdForm (params = {}) {
    return json(`${domain}/anzren/cgjd/queryCgjdForm`, params)
  },
  queryCgjdFormList (params = {}) {
    return get(`${domain}/anzren/cgjd/queryCgjdFormList`, params)
  },
  submitCgjdForm (params = {}) {
    return json(`${domain}/anzren/cgjd/submitCgjdForm`, params)
  },
  printCgjdForm (params = {}) {
    return json(`${domain}/anzren/cgjd/printCgjdForm`, params)
  },
  persistCgjdForm (params = {}) {
    return json(`${domain}/anzren/cgjd/persistCgjdForm`, params)
  },
  deleteCgjdForm (params = {}) {
    return json(`${domain}/anzren/cgjd/deleteCgjdForm`, params)
  },
  getCurrentMemberForm (params = {}) {
    return json(`${domain}/anzren/member/getCurrentMemberForm`, params)
  },
  regist4Bg (params = {}) { // 会员表单提交
    return json(`${domain}/anzren/member/regist4Bg`, params)
  },
  showArticleByCode (params = {}) {
    return json(`${domain}/main/showArticleByCode/CJCGPJ_SBXT_PJXZ`, params)
  },
  CYPY_KJCXJ_WJTZ (params = {}) {
    return json(`${domain}/main/showArticleByCode/CYPY_KJCXJ_WJTZ`, params)
  },
  CYPY_KJCXJ_PXFF (params = {}) {
    return json(`${domain}/main/showArticleByCode/CYPY_KJCXJ_PXFF`, params)
  },
  getPdfByString (params = {}, str) {
    return json(`${domain}/main/showArticleByCode/${str}`, params)
  }
}
